package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.CinemaOrder;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.CinemaOrderMapper;
import com.ruoyi.system.service.ICinemaOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 订单表Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-18
 */
@Service
public class CinemaOrderServiceImpl implements ICinemaOrderService
{
    @Autowired
    private CinemaOrderMapper cinemaOrderMapper;

    /**
     * 查询订单表
     * 
     * @param id 订单表ID
     * @return 订单表
     */
    @Override
    public CinemaOrder selectCinemaOrderById(String id)
    {
        return cinemaOrderMapper.selectCinemaOrderById(id);
    }

    /**
     * 查询订单表列表
     * 
     * @param cinemaOrder 订单表
     * @return 订单表
     */
    @Override
    public List<CinemaOrder> selectCinemaOrderList(CinemaOrder cinemaOrder)
    {
        return cinemaOrderMapper.selectCinemaOrderList(cinemaOrder);
    }

    /**
     * 新增订单表
     * 
     * @param cinemaOrder 订单表
     * @return 结果
     */
    @Override
    public int insertCinemaOrder(CinemaOrder cinemaOrder)
    {
        cinemaOrder.setCreateTime(DateUtils.getNowDate());
        return cinemaOrderMapper.insertCinemaOrder(cinemaOrder);
    }

    /**
     * 修改订单表
     * 
     * @param cinemaOrder 订单表
     * @return 结果
     */
    @Override
    public int updateCinemaOrder(CinemaOrder cinemaOrder)
    {
        cinemaOrder.setUpdateTime(DateUtils.getNowDate());
        return cinemaOrderMapper.updateCinemaOrder(cinemaOrder);
    }

    /**
     * 批量删除订单表
     * 
     * @param ids 需要删除的订单表ID
     * @return 结果
     */
    @Override
    public int deleteCinemaOrderByIds(String[] ids)
    {
        return cinemaOrderMapper.deleteCinemaOrderByIds(ids);
    }

    /**
     * 删除订单表信息
     * 
     * @param id 订单表ID
     * @return 结果
     */
    @Override
    public int deleteCinemaOrderById(String id)
    {
        return cinemaOrderMapper.deleteCinemaOrderById(id);
    }
}
